function setButton(id, textYn, iconId) {
	$(id).button({
		icons : {
			primary : iconId
		},
		text : textYn
	});
}

function cfGoToPage(url, pageId, param) {
	var urlString = url;
	
	if(pageId!=undefined && pageId!=null && pageId.length>0){
		urlString = urlString + "?id="+escape(pageId);
	}
	
	if(param!=undefined && param!=null && param.length>0){
		urlString = urlString + "&"+param; 
	}
	
	window.location.href = urlString;
}

var alertTest=function(value){
	if (typeof value == 'undefined' ) value = 'test alert';
	alert("test alert");
};

/*
 * For Reference
 * http://fancybox.net/home
 */
function setFancyBox(imgSrcUrlList, title){
	
	$.fancybox(imgSrcUrlList, {
		type			: "image",
		'padding'       : 0,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'speedIn'		: 600, 
		'speedOut'		: 200, 
		'overlayShow'	: true,
		'autoScale'		: true,
		'titleShow'     : true,
		'title' 		: title,
		'centerOnScroll': true,
		'showNavArrows' : true,
		'titlePosition' : 'outside', //'inside','over','outside'
        'easingIn'      : 'easeOutBack',
        'easingOut'     : 'easeInBack',
        'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
            //return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
            var titleFormat = ''+
            '<div id="fancybox-title" class="fancybox-title-float" style="left: 82px; display: block; ">'+
            '	<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0">'+
                    '<tbody>'+
                       '<tr>'+
                           '<td id="fancybox-title-float-left"></td>'+
                           '<td id="fancybox-title-float-main">'+(currentIndex + 1) + ' / ' + currentArray.length + ' ' + title+'</td>'+
                           '<td id="fancybox-title-float-right"></td>'+
                       '</tr>'+
                    '</tbody> '+
            '	</table>'+
            '</div>';
            return titleFormat;
        },
        'modal' : false
    });
}

function isNotEmpty(value){
	if(value!=undefined && value!=null)
		return true;
	return false;
}


/*CAPTCHA*/
var RecaptchaOptions = {
	    theme: 'red' //'white' 'custom' 'clean' 'blackglass'
        //,custom_theme_widget: 'recaptcha_widget'
	 };

function initCaptcha(){
	$("#recaptcha_image").css({
		border:"0 !important"
	});
}






























